<template>
    <div>
      <h3>这是第八个demo:watch:监听ref:基本数据类型</h3>
      <p>我有{{ flower }}朵花</p>
      <button @click="reduceFlower">减少</button>
    </div>
  </template>
  
  <script setup>
  import { ref, watch} from 'vue'
      let flower = ref(30);
      function reduceFlower() {
          flower.value -= 1;
      }
     const List =  watch(flower,(newValue,oldValue) => {
          if(newValue <= 26) {
              List();
          }
      })
  </script>
  <style lang='scss' scoped>
  
  </style>